package fr.uhp.mpr.tools;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;

import fr.uhp.mpr.data.Intervalle;

public class RainView extends JPanel{
	
	private static final long serialVersionUID = 1L;

	public RainView(Intervalle rain, double confiance, Intervalle i){
		
		super();
		
		ImageIcon imgRAIN = new ImageIcon("img/MetzWeather_RAIN.png");
		ImageIcon imgNORAIN = new ImageIcon("img/MetzWeather_NORAIN.png");
		
		JLabel label = new JLabel();
		
		if(rain.getEnd() == 0)
			label.setIcon(imgNORAIN);
		else
			label.setIcon(imgRAIN);
			
		label.setPreferredSize(new Dimension(200,259));
		
		setLayout(new BorderLayout());
		add(label,BorderLayout.CENTER);

		JTextArea text = new JTextArea("Temperature " + i.display() + "°C");
		text.setEditable(false);
		add(text,BorderLayout.SOUTH);

	}

}
